package com.xfb.user.service;

import com.xfb.api.service.EmailService;
import com.xfb.user.config.MailUtil;
import com.xfb.user.dao.EmailMapper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;

/**
 * @Auther: Xing Fang Bin
 * @Date: 2021/10/29/16:53
 * @Description:
 */
@Service
public class EmailServiceImpl implements EmailService {

    @Autowired
    private EmailMapper emailMapper;


    public boolean sendEmail(String email) {
        Map selectEmail = emailMapper.selectEmail(email);

        MailUtil.sendSimpleMail(new String[]{selectEmail.get("email").toString()}, "注册账号", selectEmail.get("code").toString(), false);

        return true;
    }

}
